package AgentPc;

import lejos.pc.comm.NXTCommException;
import lejos.pc.comm.NXTConnector;

public class Connection {
	
	private NXTConnector connection;

	public Connection() throws NXTCommException {
		boolean connected = true;
		connection = new NXTConnector();
		try {
			connected = connection.connectTo("btspp://");
		} catch (Exception ex) {
			ex.printStackTrace();
		}
		if (!connected) {
			System.err.println("Failed to connect to any NXT");
			System.exit(1);
		}
		System.out.println(connection.getNXTInfo().name + " " + connection.getNXTInfo().deviceAddress);
		// this.dataInput = this.connection.getDataIn();
		// this.dataOutput = this.connection.getDataOut();

	}
}
